<template name="container">
  <ant-Drawer
    title="交易详情"
    width="100%"
    placement="right"
    closable={true}
    visible={visible}
    maskClosable={true}
    onClose={onCloseblockDetails}
    class="{styles.transaction}"
  >
    <div class="{styles.option}">
      交易哈希：{data.transactionContent.hash.value}
    </div>
    <div class="{styles.option}">
      交易时间：{data.transactionContent.timestamp && moment(+data.transactionContent.timestamp).format('YYYY-MM-DD hh:mm:ss')}
    </div>
    <div class="{styles.option}">
      执行状态： {data.executionState}
    </div>
    <#if {{data.endpointSignatures}}>
      <BlockCollapse title="终端签名列表">
        <#each {{data.endpointSignatures}}>
          <BlockCollapseSmall  title=" 公钥：{{this.pubKey.value}}" sign="公钥算法：{{tranBase58(this.pubKey.value)}}">
            签名：{{this.digest.value}}
          </BlockCollapseSmall>
        </#each>
      </BlockCollapse>
    </#if>
    <#if {{data.nodeSignatures}}>
      <BlockCollapse title="节点签名列表">
        <#each {{data.nodeSignatures}}>
           <BlockCollapseSmall  title=" 公钥：{{this.pubKey.value}}" sign="公钥算法：{{tranBase58(this.pubKey.value)}}">
            签名：{{this.digest.value}}
          </BlockCollapseSmall>
        </#each>
      </BlockCollapse>
    </#if>
    <#if {{data.transactionContent.operations}}>
      <BlockCollapse title="交易内容">
        <#each {{data.transactionContent.operations}}>
          <#if {{this.writeSet}}>
            <BlockCollapsePanel title="数据写入">
              <h4 style="font-size: 14px;color: #333333;line-height: 14px;    font-weight: bold;margin:16px 0;">写入
              </h4>
              <fj-Row style="margin:16px 0;">
              <fj-Col l=2>账户地址：</fj-Col>
              <fj-Col l=10>{{this.accountAddress.value}} </fj-Col>
              </fj-Row>
              <#each {{this.writeSet}}>
                <BlockCollapseSmall  title="键：{{this.key}}">
                  值：{{formatData(this.value.type,this.value.value)}}<br>
                  预期版本：{{this.expectedVersion}}<br>
                  类型：{{this.value.type}}
                </BlockCollapseSmall>
              </#each>
            </BlockCollapsePanel>
          </#if>
          <#if {{this.contractID}}>
            <BlockCollapsePanel title="合约发布">
              <table style="line-height:41px;">
                <tr>
                  <td>合约地址：</td>
                  <td>{{this.contractID.address.value}}</td>
                </tr>
                <tr>
                  <td>合约公钥算法：</td>
                  <td>{{tranBase58(this.contractID.pubKey.value)}}</td>
                </tr>
                <tr>
                  <td>合约公钥：</td>
                  <td>{{this.contractID.pubKey.value}}</td>
                </tr>
                <tr>
                  <td>合约内容：</td>
                  <td>{{this.chainCode}}</td>
                </tr>
              </table>
            </BlockCollapsePanel>
          </#if>
          <#if {{this.contractAddress}}>
            <BlockCollapsePanel title="合约事件操作">
              <table style="line-height:41px;">
                <tr>
                  <td>合约参数：</td>
                  <td>{{argsToList(this.args)}}</td>
                </tr>
                <tr>
                  <td>合约地址：</td>
                  <td>{{this.contractAddress.value}} </td>
                </tr>
                <tr>
                  <td>合约事件：</td>
                  <td>{{this.event}}</td>
                </tr>
              </table>
            </BlockCollapsePanel>
          </#if>
          <#if {{this.accountID}}>
            <BlockCollapsePanel title="数据账户注册">
              <table style="line-height:41px;">
                <tr>
                  <td>数据账户地址：</td>
                  <td>{{this.accountID.address.value}}</td>
                </tr>
                <tr>
                  <td>账户公钥算法：</td>
                  <td>{{tranBase58(this.accountID.pubKey.value)}}</td>
                </tr>
                <tr>
                  <td>账户公钥：</td>
                  <td>{{this.accountID.pubKey.value}}</td>
                </tr>
              </table>
            </BlockCollapsePanel>
          </#if>
          <#if {{this.userID}}>
            <BlockCollapsePanel title="注册用户">
              <table style="line-height:41px;">
                <tr>
                  <td>用户地址：</td>
                  <td>{{this.userID.address.value}}</td>
                </tr>
                 <tr>
                  <td>用户公钥算法：</td>
                  <td>{{tranBase58(this.userID.pubKey.value)}}</td>
                </tr>
                <tr>
                  <td>用户公钥数据：</td>
                  <td>{{this.userID.pubKey.value}}</td>
                </tr>
              </table>
            </BlockCollapsePanel>
          </#if>

          <#if {{this.participantName && this.networkAddress}}>
            <BlockCollapsePanel title="参与方信息">
              <table style="line-height:41px;">
                <tr>
                  <td>参与方名称：</td>
                  <td>{{this.participantName}}</td>
                </tr>
                <tr>
                  <td>参与方端口：</td>
                  <td>{{tranBase58(this.networkAddress.port)}}</td>
                </tr>
                 <tr>
                  <td>参与方域名：</td>
                  <td>{{tranBase58(this.networkAddress.host)}}</td>
                </tr>
              </table>
            </BlockCollapsePanel>
          </#if>

          <#if {{this.participantRegisterIdentity}}>
            <BlockCollapsePanel title="注册参与方">
              <table style="line-height:41px;">
                <tr>
                  <td>参与方地址：</td>
                  <td>{{this.participantRegisterIdentity.address.value}}</td>
                </tr>
                 <tr>
                  <td>参与方公钥算法：</td>
                  <td>{{tranBase58(this.participantRegisterIdentity.pubKey.value)}}</td>
                </tr>
                <tr>
                  <td>参与方公钥数据：</td>
                  <td>{{this.participantRegisterIdentity.pubKey.value}}</td>
                </tr>
              </table>
            </BlockCollapsePanel>
          </#if>

          <#if {{this.stateUpdateIdentity}}>
            <BlockCollapsePanel title="更新参与方">
              <table style="line-height:41px;">
                <tr>
                  <td>参与方地址：</td>
                  <td>{{this.stateUpdateIdentity.address.value}}</td>
                </tr>
                 <tr>
                  <td>参与方公钥算法：</td>
                  <td>{{tranBase58(this.stateUpdateIdentity.pubKey.value)}}</td>
                </tr>
                <tr>
                  <td>参与方公钥数据：</td>
                  <td>{{this.stateUpdateIdentity.pubKey.value}}</td>
                </tr>
              </table>
            </BlockCollapsePanel>
          </#if>
        </#each>
      </BlockCollapse>
    </#if>
  </ant-Drawer>
</template>